import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue')
  }, {
    path: '/mall',
    name: 'Mall',
    component: () => import('../views/Mall.vue')
  }, {
    path: '/cart',
    name: 'Cart',
    component: () => import('../views/Cart.vue')
  }, {
    path: '/mine',
    name: 'Mine',
    component: () => import('../views/Mine.vue')
  }, {
    path: '/user',
    name: 'User',
    component: () => import('../views/person/User.vue'),
  }, {
    path: '/user/updName',
    name: 'updName',
    component: () => import('../views/person/children/UpdName.vue')
  }, {
    path: '/user/updPhone',
    name: 'updPhone',
    component: () => import('../views/person/children/updPhone.vue')
  },



  {
    path: '/exchangeRecord',
    name: 'exchange',
    component: () => import('../views/person/children/exchange.vue')
  }, {
    path: '/user/exchangecoupon/:id?',
    name: 'exchangecoupon',
    component: () => import('../views/person/children/exchangecoupon.vue')
  }, {
    path: '/user/setup',
    name: 'setup',
    component: () => import('../views/person/children/setup.vue')
  },
  {
    path: '/user/addresslist',
    name: 'addresslist',
    component: () => import('../views/person/children/addresslist.vue')
  },
  {
    path: '/user/editaddress',
    name: 'editaddress',
    component: () => import('../views/person/children/editaddress.vue')
  }, {
    path: '/user/myjinbi',
    name: 'myjinbi',
    component: () => import('../views/person/children/myjinbi.vue')
  },
  {
    path: '/productDetail',
    name: 'productDetail',
    component: () => import('../views/productDetail.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/user/Login.vue')
  }, {
    path: '/register',
    name: 'Register',
    component: () => import('../views/user/Register.vue')
  }, {
    path: '/forgetPassword',
    name: 'forgetPassword',
    component: () => import('../views/user/forgetPassword.vue')
  }, {
    path: '/notice',
    name: 'Notice',
    component: () => import('../views/Notice.vue')
  },
  {
    path: '*',
    redirect: "/"
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
